package com.gamelife.web.exception;

import com.gamelife.web.constant.ResponseEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class BaseException extends RuntimeException{
    private Integer code;
    private String msg;

    public BaseException(Integer code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public BaseException(Integer code,String msg,Throwable throwable){
        super(throwable);
        this.code = code;
        this.msg = msg;
    }

    public BaseException(ResponseEnum responseEnum){
        this.code = responseEnum.getCode();
        this.msg = responseEnum.getMsg();
    }
    public BaseException(ResponseEnum responseEnum,Throwable throwable){
        super(throwable);
        this.code = responseEnum.getCode();
        this.msg = responseEnum.getMsg();
    }

}
